<?php

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;
use App\Http\Controllers\Plugin\DirectUploadController;
use App\Http\Controllers\Manage\DashboardController;
use App\Http\Controllers\Manage\PriceRangeController;
use App\Http\Controllers\Manage\QuotaionInformationController;
//配置
Route::post('config/list',[\App\Http\Controllers\ConfigController::class,'list']);
Route::post('config/store',[\App\Http\Controllers\ConfigController::class,'store']);
Route::post('config/edit',[\App\Http\Controllers\ConfigController::class,'edit']);
Route::post('config/update',[\App\Http\Controllers\ConfigController::class,'update']);
Route::prefix('main')->group(function() {
    Route::post('main_type/list', [\App\Http\Controllers\Main\MainTypeController::class, 'list']);
    Route::post('main_platform/list', [\App\Http\Controllers\Main\MainPlatformController::class, 'list']);
});

//权限管理
Route::middleware('auth:sanctum')->prefix('main')->group(function(){
    Route::post('wechat/get_article',[\App\Http\Controllers\Wechat\CommonController::class,'getArticle']);
});
//本地上传
Route::prefix('local_upload')->group(function(){
    Route::post('upload_file', [\App\Http\Controllers\Plugin\LocalUploadFileController::class,'upload']);
    Route::post('delete_file', [\App\Http\Controllers\Plugin\LocalUploadFileController::class,'deleteFile']);
    Route::post('download', [\App\Http\Controllers\Plugin\LocalUploadFileController::class,'download']);
});
//图片直传
Route::prefix('direct_upload')->group(function(){
    Route::post('upload_app_token', [DirectUploadController::class,'getAppToken']);
    Route::post('upload_web_token', [DirectUploadController::class,'getWebToken']);
    Route::post('call_back', [DirectUploadController::class,'callback']);
});
//图片上传
Route::prefix('upload')->group(function(){
    Route::post('single',[\App\Http\Controllers\Plugin\UploadImageController::class,'upload']);
    Route::post('multi',[\App\Http\Controllers\Plugin\UploadImageController::class,'multiImgs']);
//    Route::post('local',[UploadImageController::class,'upload']);

});
Route::prefix('main')->group(function() {
    Route::post('generator',[\App\Http\Controllers\Main\ScoreController::class,'generator']);
    Route::post('index',[\App\Http\Controllers\Main\LocalTestController::class,'index']);

});
Route::prefix('manage')->group(function() {
    // 导入客户
    Route::post('customer_manage/import_customer',[\App\Http\Controllers\Manage\CustomerManageController::class,'importCustomer']);
});

//管理端
Route::middleware('auth:sanctum')->prefix('manage')->group(function() {
    //公司分类
    Route::post('company_category/list',[\App\Http\Controllers\Manage\CompanyCategoryController::class,'list']);
    Route::post('company_category/store',[\App\Http\Controllers\Manage\CompanyCategoryController::class,'store']);
    Route::post('company_category/edit',[\App\Http\Controllers\Manage\CompanyCategoryController::class,'edit']);
    Route::post('company_category/update',[\App\Http\Controllers\Manage\CompanyCategoryController::class,'update']);
    Route::post('company_category/destory',[\App\Http\Controllers\Manage\CompanyCategoryController::class,'destory']);
    //客户管理
    Route::post('customer_manage/list',[\App\Http\Controllers\Manage\CustomerManageController::class,'list']);
    Route::post('customer_manage/store',[\App\Http\Controllers\Manage\CustomerManageController::class,'store']);
    Route::post('customer_manage/edit',[\App\Http\Controllers\Manage\CustomerManageController::class,'edit']);
    Route::post('customer_manage/update',[\App\Http\Controllers\Manage\CustomerManageController::class,'update']);
    Route::post('customer_manage/destory',[\App\Http\Controllers\Manage\CustomerManageController::class,'destory']);

// 下载模板
    Route::post('customer_manage/download_customer_template',[\App\Http\Controllers\Manage\CustomerManageController::class,'downLoadCustomerTemplate']);

    //客户报价
    Route::post('customer_prepare/list',[\App\Http\Controllers\Manage\CustomerPrepareController::class,'list']);
    Route::post('customer_prepare/store',[\App\Http\Controllers\Manage\CustomerPrepareController::class,'store']);
    Route::post('customer_prepare/edit',[\App\Http\Controllers\Manage\CustomerPrepareController::class,'edit']);
    Route::post('customer_prepare/update',[\App\Http\Controllers\Manage\CustomerPrepareController::class,'update']);
    Route::post('customer_prepare/destory',[\App\Http\Controllers\Manage\CustomerPrepareController::class,'destory']);
    //店铺管理
    Route::post('shop_detail/list',[\App\Http\Controllers\Manage\ShopController::class,'list']);
    Route::post('shop_detail/store',[\App\Http\Controllers\Manage\ShopController::class,'store']);
    Route::post('shop_detail/edit',[\App\Http\Controllers\Manage\ShopController::class,'edit']);
    Route::post('shop_detail/update',[\App\Http\Controllers\Manage\ShopController::class,'update']);
    Route::post('shop_detail/destory',[\App\Http\Controllers\Manage\ShopController::class,'destory']);
    Route::post('shop_detail/final_shop',[\App\Http\Controllers\Manage\ShopManageController::class,'finalShop']);
    Route::post('shop_detail/shop',[\App\Http\Controllers\Manage\ShopController::class,'shop']);
    Route::post('shop_detail/final_shop',[\App\Http\Controllers\Manage\ShopController::class,'finalShop']);
    //更新店铺部门id
    Route::post('shop_detail/set_shop_department',[\App\Http\Controllers\Manage\ShopController::class,'setShopDepartment']);

    //导入快捷语shop_manage/
    Route::post('short_cut/import_short_cut',[\App\Http\Controllers\Manage\ShopManageController::class,'importShotCut']);
    Route::post('short_cut/down_load_import_short',[\App\Http\Controllers\Manage\ShopManageController::class,'downLoadShotCut']);

    //获取有未读更新
    Route::post('shop_detail/check_update',[\App\Http\Controllers\Manage\ShopController::class,'checkUpdate']);
    //设置未读变成已读消息
    Route::post('shop_detail/set_read',[\App\Http\Controllers\Manage\ShopController::class,'setRead']);

    //操作基本信息
    Route::post('shop_manage/operator_message',[\App\Http\Controllers\Manage\ShopManageController::class,'operatorMessage']);
    //设置已读
    Route::post('shop_manage/is_read',[\App\Http\Controllers\Manage\ShopManageController::class,'isRead']);
    Route::post('shop_detail/history',[\App\Http\Controllers\Manage\ShopController::class,'getHistory']);
    Route::post('shop_detail/get_unread_list',[\App\Http\Controllers\Manage\ShopController::class,'getUnreadList']);
    //分配客服
    Route::post('shop_detail/distribution',[\App\Http\Controllers\Manage\ShopController::class,'distribution']);

    //导入快捷语shop_manage/ 已废弃
    Route::post('shop_manage/import_short_cut',[\App\Http\Controllers\Manage\ShopManageController::class,'importShotCut']);
    Route::post('shop_manage/down_load_import_short',[\App\Http\Controllers\Manage\ShopManageController::class,'downLoadShotCut']);

    //掌柜语录
    Route::post('shop_keeper/list',[\App\Http\Controllers\Manage\ShopKeeperController::class,'list']);
    Route::post('shop_keeper/store',[\App\Http\Controllers\Manage\ShopKeeperController::class,'store']);
    Route::post('shop_keeper/edit',[\App\Http\Controllers\Manage\ShopKeeperController::class,'edit']);
    Route::post('shop_keeper/update',[\App\Http\Controllers\Manage\ShopKeeperController::class,'update']);
    Route::post('shop_keeper/destory',[\App\Http\Controllers\Manage\ShopKeeperController::class,'destory']);
    //查询是否有更新内容
    Route::post('shop_keeper/check_update',[\App\Http\Controllers\Manage\ShopKeeperController::class,'checkUpdate']);
    //设置未读变成已读
    Route::post('shop_keeper/set_read',[\App\Http\Controllers\Manage\ShopKeeperController::class,'setRead']);
    //本地测试使用
    Route::post('test/index',[\App\Http\Controllers\Manage\TestController::class,'index']);
    //培训资料
    Route::post('train_material/list',[\App\Http\Controllers\Manage\TrainMaterialController::class,'list']);
    Route::post('train_material/store',[\App\Http\Controllers\Manage\TrainMaterialController::class,'store']);
    Route::post('train_material/edit',[\App\Http\Controllers\Manage\TrainMaterialController::class,'edit']);
    Route::post('train_material/update',[\App\Http\Controllers\Manage\TrainMaterialController::class,'update']);
    Route::post('train_material/destory',[\App\Http\Controllers\Manage\TrainMaterialController::class,'destory']);
    //获取有未读更新
    Route::post('train_material/check_update',[\App\Http\Controllers\Manage\TrainMaterialController::class,'checkUpdate']);
    //设置未读变成已读消息
    Route::post('train_material/set_read',[\App\Http\Controllers\Manage\TrainMaterialController::class,'setRead']);
    //快捷短语
    Route::post('short_cut/list',[\App\Http\Controllers\Manage\ShrotCutController::class,'list']);
    Route::post('short_cut/store',[\App\Http\Controllers\Manage\ShrotCutController::class,'store']);
    Route::post('short_cut/edit',[\App\Http\Controllers\Manage\ShrotCutController::class,'edit']);
    Route::post('short_cut/update',[\App\Http\Controllers\Manage\ShrotCutController::class,'update']);
    Route::post('short_cut/destory',[\App\Http\Controllers\Manage\ShrotCutController::class,'destory']);
    //获取有未读更新短语
    Route::post('short_cut/check_update',[\App\Http\Controllers\Manage\ShrotCutController::class,'checkUpdate']);
    //快捷语设置已读
    Route::post('short_cut/set_read',[\App\Http\Controllers\Manage\ShrotCutController::class,'setRead']);

//    客诉管理
    Route::post('customer_complaint/list',[\App\Http\Controllers\Manage\CustomerComplaintController::class,'list']);
    Route::post('customer_complaint/store',[\App\Http\Controllers\Manage\CustomerComplaintController::class,'store']);
    Route::post('customer_complaint/edit',[\App\Http\Controllers\Manage\CustomerComplaintController::class,'edit']);
    Route::post('customer_complaint/update',[\App\Http\Controllers\Manage\CustomerComplaintController::class,'update']);
    Route::post('customer_complaint/destory',[\App\Http\Controllers\Manage\CustomerComplaintController::class,'destory']);
    //获取是否有未读消息
    Route::post('customer_complaint/check_update',[\App\Http\Controllers\Manage\CustomerComplaintController::class,'checkUpdate']);
    //设置未读变成已读消息
    Route::post('customer_complaint/set_read',[\App\Http\Controllers\Manage\CustomerComplaintController::class,'setRead']);
    //    公告管理
    Route::post('announcement/list',[\App\Http\Controllers\Manage\AnnouncementController::class,'list']);
    Route::post('announcement/store',[\App\Http\Controllers\Manage\AnnouncementController::class,'store']);
    Route::post('announcement/edit',[\App\Http\Controllers\Manage\AnnouncementController::class,'edit']);
    Route::post('announcement/update',[\App\Http\Controllers\Manage\AnnouncementController::class,'update']);
    Route::post('announcement/destory',[\App\Http\Controllers\Manage\AnnouncementController::class,'destory']);
    Route::post('announcement/get_unread_list',[\App\Http\Controllers\Manage\AnnouncementController::class,'getOrderList']);
    Route::post('announcement/setRead',[\App\Http\Controllers\Manage\AnnouncementController::class,'setRead']);
    //    加班单管理
    Route::post('work_over_time/list',[\App\Http\Controllers\Manage\WorkOverTimeController::class,'list']);
    Route::post('work_over_time/store',[\App\Http\Controllers\Manage\WorkOverTimeController::class,'store']);
    Route::post('work_over_time/edit',[\App\Http\Controllers\Manage\WorkOverTimeController::class,'edit']);
    Route::post('work_over_time/update',[\App\Http\Controllers\Manage\WorkOverTimeController::class,'update']);
    Route::post('work_over_time/destory',[\App\Http\Controllers\Manage\WorkOverTimeController::class,'destory']);
    //    品控管理
    Route::post('quality_control/list',[\App\Http\Controllers\Manage\QualityControlController::class,'list']);
    Route::post('quality_control/store',[\App\Http\Controllers\Manage\QualityControlController::class,'store']);
    Route::post('quality_control/edit',[\App\Http\Controllers\Manage\QualityControlController::class,'edit']);
    Route::post('quality_control/update',[\App\Http\Controllers\Manage\QualityControlController::class,'update']);
    Route::post('quality_control/destory',[\App\Http\Controllers\Manage\QualityControlController::class,'destory']);
    //    续费回访管理
    Route::post('renew_manage/list',[\App\Http\Controllers\Manage\RenewManageController::class,'list']);
    Route::post('renew_manage/store',[\App\Http\Controllers\Manage\RenewManageController::class,'store']);
    Route::post('renew_manage/edit',[\App\Http\Controllers\Manage\RenewManageController::class,'edit']);
    Route::post('renew_manage/update',[\App\Http\Controllers\Manage\RenewManageController::class,'update']);
    Route::post('renew_manage/destory',[\App\Http\Controllers\Manage\RenewManageController::class,'destory']);
    //工作台
    Route::post('dashboard/list',[DashboardController::class,'list']);
    Route::post('dashboard/today_info',[DashboardController::class,'todayInfo']);
    Route::post('dashboard/yesterday_info',[DashboardController::class,'yesterdayInfo']);
    Route::post('dashboard/towdays_info',[DashboardController::class,'towdaysInfo']);
    Route::post('dashboard/senven_info',[DashboardController::class,'senvenInfo']);
    Route::post('dashboard/unread_update',[DashboardController::class,'unreadUpdate']);

    //报价信息
    Route::post('quotaion_information/list',[QuotaionInformationController::class,'list']);
    Route::post('quotaion_information/store',[QuotaionInformationController::class,'store']);
    Route::post('quotaion_information/update',[QuotaionInformationController::class,'update']);
    Route::post('quotaion_information/edit',[QuotaionInformationController::class,'edit']);
    //价格区间
    Route::post('price_range/update',[PriceRangeController::class,'update']);
    Route::post('price_range/store',[PriceRangeController::class,'store']);
    Route::post('price_range/delete',[PriceRangeController::class,'destory']);

});
Route::prefix('ad')->group(function() {
    Route::post('callback',[\App\Http\Controllers\Main\CallbackController::class,'notify']);
});

Route::prefix('manage')->group(function() {
    //建议与评价管理
    Route::post('suggest_and_evaluation/list',[\App\Http\Controllers\Manage\SuggestAndEvaluationController::class,'list']);
    Route::post('suggest_and_evaluation/store',[\App\Http\Controllers\Manage\SuggestAndEvaluationController::class,'store']);
    Route::post('suggest_and_evaluation/edit',[\App\Http\Controllers\Manage\SuggestAndEvaluationController::class,'edit']);
    Route::post('suggest_and_evaluation/update',[\App\Http\Controllers\Manage\SuggestAndEvaluationController::class,'update']);
    Route::post('suggest_and_evaluation/destory',[\App\Http\Controllers\Manage\SuggestAndEvaluationController::class,'destory']);

});
Route::prefix('ad')->group(function() {
    Route::post('callback',[\App\Http\Controllers\Main\CallbackController::class,'notify']);

});


